home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / OpenDoc / ProcessMap / $Utilities / FrameList.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-06  |  1.6 KB  |  72 lines  |  [TEXT/MPCC]

  1. /*
  2.     File:        FrameList.h
  3.  
  4.     Contains:    Linked list of frames, for use by parts
  5.  
  6.     Written by:    PartMaker
  7.  
  8.     Theory of Operation:
  9.         This is a quick-n-dirty linked list of ODFrames. To use it, create a
  10.         FrameList and use the Add and Remove methods to add/remove frames.
  11.         To iterate over all the frames, do something like this:
  12.         
  13.             for ( FrameLink *fl = frameList.First(); fl->Frame(); fl = fl->Next() )
  14.                 DoSomethingWithFrame( fl->Frame() );
  15.  
  16.     Copyright:    © 1995 by Apple Computer, Inc., all rights reserved.
  17.  
  18.     Change History (most recent first):
  19.  
  20.          <2>      3/8/95    JS        Updated to b1c13/c14
  21.          <1>      2/2/95    RA        first checked in
  22.  
  23.          <0>    PartMaker source by Eric Soldan, Tantek Çelik, Jens Alfke, Reggie Adkins
  24. */
  25.  
  26. #ifndef _FRAMELIST_
  27. #define _FRAMELIST_
  28.  
  29.  
  30. class ODFrame;
  31.  
  32.  
  33. //========================================================================================
  34. // FrameLink
  35. //========================================================================================
  36.  
  37. class FrameLink
  38. {
  39. public:
  40.     
  41.     ODFrame*    Frame( )                    {return fFrame;}
  42.     FrameLink*    Next( )                        {return fNext;}
  43.     
  44. protected:
  45.                 FrameLink( ODFrame*, FrameLink *list );
  46.                 FrameLink( );
  47.                 ~FrameLink( );
  48.                 
  49.     ODFrame        *fFrame;
  50.     FrameLink    *fPrev,
  51.                 *fNext;
  52.  
  53.     friend class FrameList;
  54. };
  55.  
  56.  
  57. //========================================================================================
  58. // FrameList
  59. //========================================================================================
  60.  
  61. class FrameList : public FrameLink
  62. {
  63. public:
  64.                 FrameList( );
  65.                 ~FrameList( );
  66.     void        Add( ODFrame* );
  67.     void        Remove( ODFrame* );
  68.     void        InvalAllFrames( );
  69.     FrameLink*    First( )                    {return fNext;}
  70. };
  71.  
  72. #endif